<?php include_once './application/views/sys_admin/common/header.php';  ?>
<!-- admin_main -->
<div class="admin_main">
	<!-- Admin_top end -->
	<?php include_once './application/views/sys_admin/common/account_left.php';  ?>
	<!-- Admin_Left End -->
	<div class="admin_right">
		<div class="admin_right_title">
			<strong>资金管理</strong> &gt;&gt;  流转未还款列表
		</div>
		
		<div class="admin_right_con">
			<table border="0" cellspacing="1" cellpadding="0">
			  <tr style="color:#0068b7;">
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>编号</strong></td>
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>借款标题</strong></td>
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>还款金额</strong></td>
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>真实金额</strong></td>
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>马甲</strong></td>
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>借款周期</strong></td>
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>应还时间</strong></td>
			  </tr>
			  <?php foreach($repayment_list as $key=>$repayment){?>
			  <tr>
				<td height="35" align="center" valign="middle" bgcolor="#FFFFFF"><?php echo $repayment['id'];?></td>
				<td height="35" align="center" valign="middle" bgcolor="#FFFFFF"><?php echo $repayment['title'];?></td>
				<td height="35" align="center" valign="middle" bgcolor="#FFFFFF"><?php echo $repayment['repay_accounts'];?></td>
				<td height="35" align="center" valign="middle" bgcolor="#FFFFFF"><?php echo $repayment['repay_accounts']-$repayment['repayment_account_majia'];?></ktd>
				<td height="35" align="center" valign="middle" bgcolor="#FFFFFF"><?php echo number_format($repayment['repayment_account_majia'],2);?></ktd>
				<td height="35" align="center" valign="middle" bgcolor="#FFFFFF"><?php echo $repayment['forder']+1;?>/<?php echo $repayment['time_limit'];?></td>
				<td height="35" align="center" valign="middle" bgcolor="#FFFFFF"><?php echo date('Y-m-d',$repayment['repay_time']);?></td>
			  </tr>
			  <?php }?>
			  <tr>
			  	<td colspan="7" align="right">
			  		<form action="/sys_admin/borrow/lz_repayment/" method="get">
			  			标题：<input type="text" id="title" name="title" value="<?php echo $title?>" />
			  			状态：<select id="fstatus" name="fstatus">
			  				<option value="-2" <?php if($fstatus==-1){?>selected="selected"<?php }?>>所有</option>
			  				<?php foreach($var_repayment_status as $status_key=>$status_value){?>
			  				<option value="<?php echo $status_key?>" <?php if($fstatus==$status_key){?>selected="selected"<?php }?>><?php echo $status_value;?></option>
			  				<?php }?>
			  			</select>
			  			开始时间：<input type="text" id="strtime" name="strtime" size="7" value="<?php echo $strtime;?>"  onfocus="WdatePicker()" style="width: 100px;"/>
			  			结束时间：<input type="text" id="endtime" name="endtime" size="7" value="<?php echo $endtime;?>"  onfocus="WdatePicker()" style="width: 100px;"/>
			  			<input type="submit"/>
			  		</form>
			  		
			  	</td>
			  </tr>
			  <tr>
			  	<td colspan="5" align="center" valign="middle" bgcolor="#FFFFFF">还款总预还金额：<font style="color:red;"><?php echo $totalmoney;?>元</font>   &nbsp;&nbsp;&nbsp;真实总预还金额：<font style="color:red;"><?php echo $realmoney;?>元 </font></td>
			  	<td colspan="2"  height="35" align="center" valign="middle" bgcolor="#FFFFFF" ><a href="/sys_admin/borrow/lzrepaymentexcel/?title=<?php echo $title;?>&fstatus=<?php echo $fstatus;?>&strtime=<?php echo $strtime;?>&endtime=<?php echo $endtime;?>">导出数据</a></td>
			  </tr>
			  <tr>
			  	
			  	<td colspan="7"  height="35" align="center" valign="middle" bgcolor="#FFFFFF" class="page"><?php echo $this->pagination->create_links();?></td>
			  </tr>
			</table>
			</div>
	</div>
<!-- Admin_Right End -->
</div>
<!-- admin_main end -->
<script>
function repay(collection_id, borrow_id){
	$.ajax({
		type: "get",
		url: "/sys_admin/borrow/lz_repay/"+repayment_id+"/"+borrow_id,
		success: function(msg){
			$("#dialog").dialog();
			if(msg == 1){
				$("#msg").html("还款成功！");
				$("#chebiao_"+repayment_id).hide();
				setTimeout(function(){
					location.reload();
				},1000);
			}else{
				$("#msg").html(msg);
				setTimeout(function(){
					location.reload();
				},1000);
			}
		},
		dataType: "text"
	});
}
</script>
<div id="dialog" title="系统提示" style="display:none"><p id="msg" style="text-align:center"></p></div>
</body>
</html>
